package cn.edu.ctbu.labtest.domain;

import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Data;
import org.springframework.lang.NonNull;

/**
 * 针对tb_student的实体类
 */
@Data
@Entity(name = "tb_student")
public class Student {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 姓名
     * */
    @NotNull
    @Size(min = 2,max = 20,message = "请给出正确姓名")
    private String name;

    /**
     * 学号
     * */
    @NotNull
    @Size(min = 8,max = 10,message = "学号一般不超过10位")
    private String no;


    /**
     * 密码
     * */
    private String password;

    /**
     * 性别，0未知，1男，2女
     * */
    private Integer sex;

    /**
     * 年龄
     * */
    @NotNull
    @Min(value = 16)
    @Max(value = 30,message = "请输入正确年龄")
    private Integer age;

    /**
     * 成绩
     * */
    @NotNull
    @Min(value = 0)
    @Max(value = 100,message = "请确认输入成绩是否正确")
    private Integer score;
}